<style>
    .item {
        width: 180px;
        height: 180px;
        /* transparent-grid 自己命名 */
        background-image: paint(transparent-grid);
        outline: 1px solid lightcoral;
    }
</style>

<body>
    <div class="item">运用paint的套路是固定的 CSS.paintWorklet + registerPaint 注册，注册的类提供paint方法</div>
</body>
<script>
    if (window.CSS) {
        CSS.paintWorklet.addModule('paint-grid.js');
    }


</script>